package com.ruoyi.logistic.service.impl;

import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.logistic.domain.NetworkCostTicket;
import com.ruoyi.logistic.mapper.NetworkCostTicketMapper;
import com.ruoyi.logistic.service.NetworkCostTicketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class NetworkCostTicketServiceImpl implements NetworkCostTicketService {
    @Autowired
    private NetworkCostTicketMapper networkCostTicketMapper;
    @Override
    public List<NetworkCostTicket> selectAll() {
        return networkCostTicketMapper.selectAll();
    }

    @Override
    public Boolean insert(NetworkCostTicket networkCostTicket) {
        networkCostTicket.setCreateBy(SecurityUtils.getUserId());
        networkCostTicket.setUpdateBy(SecurityUtils.getUserId());
        return networkCostTicketMapper.insert(networkCostTicket);
    }

    @Override
    public Boolean update(NetworkCostTicket networkCostTicket) {
        networkCostTicket.setUpdateBy(SecurityUtils.getUserId());
        return networkCostTicketMapper.update(networkCostTicket);
    }

    @Override
    public Boolean deleteById(Integer id) {
        return networkCostTicketMapper.deleteById(id);
    }
}
